<!DOCTYPE html>
<html>
<import file="block/common.html" name="header" />

<body>
	<import file="block/common.html" name="nav" />

	<!---专题链接 START-->
	<import file="block/common.html" name="special_a_url"/>
	<!---专题链接 END-->

	<div class="layui-container">
		<div class="layui-card cxuu_top">
			<div class="layui-card-body cxuu_top_info">
				<div class="layui-col-xs7">
					<import file="block/extends.html" name="onduty" />
				</div>
				<div class="layui-col-xs5 ">
					<import file="block/common.html" name="search" />
				</div>
			</div>
		</div>

		<div id="cxuu_main">
			<div class="layui-card">
				<!--头条-->
				<div class="layui-card-body cxuu_infofirst">
					<?php foreach(CxuuList("table='article' cid='0' limit='2' cache='600' imgbl='0' attribute='1'") as $vo){?>
					<li><a href="<?php echo urlInfo($vo['id']);?>" target="_blank">
							<?php echo MbStr($vo['title'],38);?>
						</a></li>
					<?php }?>
				</div>
			</div>
			<div class="layui-row cxuu_imagefoce">
				<div class="layui-col-md7">
					<div class="layui-carousel cxuu_imgfoce" id="headerfoce">
						<div carousel-item="">
							<!--图片轮换-->
							<?php foreach(CxuuList("table='article' cid='6,3' limit='5' cache='600' imgbl='1' attribute='3'") as $vo){?>
							<div>
								<a href="<?php echo urlInfo($vo['id']);?>" target="_blank">
									<div class="imgs"><img height=400 width=640 src="<?php echo $vo['img'];?>"></div>
									<div class="title">
										<?php echo MbStr($vo['title'],30);?>
									</div>
								</a>
							</div>
							<?php }?>
						</div>
					</div>
				</div>
				<div class="layui-col-md5">
					<div class="layui-card">
						<!--小头条-->
						<div class="layui-card-header cxuu_infosecend">
							<?php foreach(CxuuList("table='article' cid='0' limit='1' cache='600' imgbl='0' attribute='2'") as $vo){?>
							<li><a href="<?php echo urlInfo($vo['id']);?>" target="_blank">
									<?php echo MbStr($vo['title'],20);?>
								</a></li>
							<?php }?>
						</div>
						<!--推荐列表位置 一般为最新内容-->
						<div class="layui-card-body cxuu_infolist">
							<ul>
								<?php foreach(CxuuList("table='article' cid='0' limit='10' cache='600'") as $vo){?>
								<li><span class="layui-badge-dot layui-bg-blue"></span> <a
										href="<?php echo urlInfo($vo['id']);?>" target="_blank">
										<?php echo MbStr($vo['title'],26);?>
									</a></li>
								<?php }?>
							</ul>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>


<!---专题链接 START-->
<import file="block/common.html" name="special_b_url"/>
<!---专题链接 END-->


	<div class="layui-container" id="cxuu_main">
		<div class="layui-row layui-col-space10">
			<div class="layui-col-md2 cxuu-applink">
			<?php foreach((array)\model\applinks::AppLinkList(8) as $vo){?>
				<div class="layui-col-md6 cxuu-applink-a"><a href="<{$vo['url']}>" target="_blank"><i class="fontsize layui-icon <{$vo['ico']}>"></i><br><{$vo['name']}></a></div>
			<?php }?>
			</div>
			<?php foreach(CxuuList("table='article_cate' id='6,7'") as $value){ ?>
			<div class="layui-col-md5">
				<div class="layui-card">
					<div class="layui-card-header cxuu_index_list_title">
						<div class="title"><a
								href="<?php if(!empty($value['urlname'])){echo urlList($value['urlname']); }else{echo urlList($value['id']);} ?>">
								<{ $value['name'] }>
							</a></div>
					</div>
					<div class="layui-card-body cxuu_infolist">
						<ul>
							<?php foreach(CxuuList("table='article' cid='{$value['id']}' limit='8' cache='600'") as $vo){?>
							<li><span class="layui-badge-dot layui-bg-blue"></span><span class="cxuu_time">
									<?php echo FTime($vo['time'],'m-d');?>
								</span> <a href="<?php echo urlInfo($vo['id']);?>" target="_blank">
									<?php echo MbStr($vo['title'],22);?>
								</a>
								<?php echo $vo['imgbl'] ==1 ?'<i class="layui-icon layui-icon-picture" style="color:#f84c4c"></i>':'';?>
							</li>
							<?php }?>
						</ul>
					</div>
				</div>
			</div>
			<?php } ?>
		</div>
	</div>

<!---专题链接 START-->
<import file="block/common.html" name="special_c_url"/>
<!---专题链接 END-->

	<div class="layui-container" id="cxuu_main">
		<div class="layui-row layui-col-space10">
			<div class="layui-col-md2">
				<div class="layui-card">
					<div class="layui-card-body cxuu_imglist">
						<!---首页图片列表--->
						<ul>
							<?php foreach(CxuuList("table='article' cid='1,2,3' limit='2' cache='600' imgbl='1' attribute='3' order='id DESC'") as $vo){?>
							<li>
								<div class="cxuu_img"><a href="<?php echo urlInfo($vo['id']);?>" target="_blank"><img
											height=120 width=170 src="<?php echo $vo['img'];?>"></a></div>
								<div class="cxuu_imgtitle"><a href="<?php echo urlInfo($vo['id']);?>" target="_blank">
										<?php echo MbStr($vo['title'],24);?>
									</a></div>
							</li>
							<?php }?>
						</ul>
					</div>
				</div>
			</div>

			<?php foreach(CxuuList("table='article_cate' id='3,9'") as $value){ ?>
			<div class="layui-col-md5">
				<div class="layui-card">
					<div class="layui-card-header cxuu_index_list_title">
						<div class="title"><a
								href="<?php if(!empty($value['urlname'])){echo urlList($value['urlname']); }else{echo urlList($value['id']);} ?>">
								<{ $value['name'] }>
							</a></div>
					</div>
					<div class="layui-card-body cxuu_infolist">
						<ul>
							<?php foreach(CxuuList("table='article' cid='{$value['id']}' limit='10' cache='600'") as $vo){?>
							<li><span class="layui-badge-dot layui-bg-blue"></span><span class="cxuu_time">
									<?php echo FTime($vo['time'],'m-d');?>
								</span> <a href="<?php echo urlInfo($vo['id']);?>" target="_blank">
									<?php echo MbStr($vo['title'],22);?>
								</a>
								<?php echo $vo['imgbl'] ==1 ?'<i class="layui-icon layui-icon-picture" style="color:#f84c4c"></i>':'';?>
							</li>
							<?php }?>
						</ul>
					</div>
				</div>
			</div>
			<?php } ?>
		</div>
	</div>

	<div class="layui-container" id="cxuu_main">
		<div class="picScroll-left">
			<div class="hd"><a href="/images/">图集</a></div>
			<div class="bd">
				<ul class="picList">
					<?php foreach(CxuuList("table='images'") as $vo){?>
					<li>
						<div class="pic"><a href="<?php echo urlImage($vo['id']);?>" target="_blank"><img
									src="<?php echo $vo['img'];?>" /></a></div>
						<div class="title"><a href="<?php echo urlImage($vo['id']);?>" target="_blank">
								<?php echo MbStr($vo['title'],22);?>
							</a></div>
					</li>
					<?php }?>
				</ul>
			</div>
		</div>
	</div>

	<div class="layui-container" id="cxuu_main">
		<div class="layui-row layui-col-space10">

			<div class="layui-col-md4">
				<div class="layui-card">
					<div class="layui-card-header cxuu_index_list_title">
						<div class="title">学习资料</div>
					</div>
					<div class="layui-card-body cxuu_infolist">
						<ul>
							<?php foreach(CxuuList("table='article' cid='1,2,3' limit='10' cache='600'") as $vo){?>
							<li><span class="layui-badge-dot layui-bg-blue"></span><span class="cxuu_time">
									<?php echo FTime($vo['time'],'m-d');?>
								</span> <a href="<?php echo urlInfo($vo['id']);?>" target="_blank">
									<?php echo MbStr($vo['title'],22);?>
								</a></li>
							<?php }?>
						</ul>
					</div>
				</div>
			</div>

			<div class="layui-col-md4">
				<div class="layui-card">
					<div class="layui-card-header cxuu_index_list_title">
						<div class="title">政策法规</div>
					</div>
					<div class="layui-card-body cxuu_infolist">
						<ul>
							<?php foreach(CxuuList("table='article' cid='1,2,3' limit='10' cache='600'") as $vo){?>
							<li><span class="layui-badge-dot layui-bg-blue"></span><span class="cxuu_time">
									<?php echo FTime($vo['time'],'m-d');?>
								</span> <a href="<?php echo urlInfo($vo['id']);?>" target="_blank">
									<?php echo MbStr($vo['title'],22);?>
								</a></li>
							<?php }?>
						</ul>
					</div>
				</div>
			</div>
			<div class="layui-col-md4">
				<div class="layui-card">
					<div class="layui-card-header cxuu_index_list_title">
						<div class="title">发布统计</div>
					</div>
					<div class="layui-card-body cxuu_infolist">
						<table class="layui-table" lay-data="{height:330, url:'/articlecount',limit: 20, id:'cxuuCount'}"
							lay-filter="cxuuCount" lay-even lay-skin="nob">
							<thead>
								<tr>
									<th lay-data="{field:'gid', width:80,type:'numbers'}">排名</th>
									<th lay-data="{field:'groupname'}">角色组</th>
									<th lay-data="{field:'total', width:80}">发布数</th>
								</tr>
							</thead>
						</table>
					</div>
				</div>
			</div>

		</div>
	</div>

	<div class="layui-container" id="cxuu_main">
		<div class="cxuu-special">
			<?php foreach(CxuuList("table='article_special' key='status' value='1' limit='10' cache='600' order='sort DESC'") as $vo){?>
				<li><a href="<{$vo['url']}>" target="_blank"><img src="<{$vo['img_a']}>" width="220" height="80"></a></li>
			<?php }?>
		</div>
	</div>

	<import file="block/common.html" name="footer" />
	
	<div class="layui-container">
		<div style="text-align: center;height: 50px;line-height: 50px;">
			本站访问统计（PV值 缓存10分钟更新）- 今日访问：<span class="visit_today"></span>
			昨日：<span class="visit_yesterday"></span>
			总访问：<span class="visit_sum"></span>
			最高日访问：<span class="visit_max"></span>
		</div>
	</div>

	<script src="<?php echo U_RES;?>/lib/jquery-1.11.3.min.js"></script>
	<script src="<?php echo U_RES;?>/lib/superslide/jquery.SuperSlide.js"></script>
	<script src="<?php echo U_RES;?>/lib/layui/layui.js" charset="utf-8"></script>
	<script>
		layui.define(function () {
			var element = layui.element,
				form = layui.form,
				carousel = layui.carousel,
				table = layui.table;

			carousel.render({
				elem: '#headerfoce'
				, width: '640px'
				, height: '430px'
				, interval: 5000
				, indicator: 'inside'
				, anim: 'fade'
			});
		});
		//图集切换
		$(".picScroll-left").slide({ titCell: ".hd ul", mainCell: ".bd ul", autoPage: true, effect: "left", autoPlay: true, vis: 6, trigger: "click" });
		//访问量调用
		$.getJSON('/visit', {}, function (data) {
			$('.visit_today').text(data['today']);
			$('.visit_yesterday').text(data['yesterday']);
			$('.visit_sum').text(data['sum']);
			$('.visit_max').text(data['max']);
		});

		//获取服务器时间 秒时间戳 用于自动生成纯静态首页
		function getServerDate() {
			var serverDate;
			$.ajax({
				async: false,
				type: "POST",
				success: function (result, status, xhr) {
					serverDate = new Date(xhr.getResponseHeader("Date"));
				},
				error: function (result, status, xhr) {
					serverDate = new Date();
				},
			});
			return serverDate.getTime() / 1000;
		}
//console.log("t="+getServerDate());
	</script>
</body>

</html>